def one_question(emails_origin):
    emails = emails_origin.strip()
    print("转换前的字符串:",emails_origin)
    list = emails.split(", ")
    print(list)
    for item1,em in enumerate(list):
        for item2,i in enumerate(em):
            if i == "@":
                list[item1] = em[:item2+1]+em[item2+1:].lower()
                continue
    print(list)
    str =", "
    emails_change = str.join(list)
    print("转换后的字符串:",emails_change)
    print("转换前后字符串长度差:",len(emails_origin)-len(emails_change))

def two_question(string):
    list = string.split("?")
    list2 = list[1].split("&")
    wd_list = list2[0].split("=")
    params_list = list2[1].split("=")
    diction = dict(zip([wd_list[0],params_list[0]],[wd_list[1],params_list[1]]))
    print(("url = {}/n params = {}").format(list[0],diction))

def three_question(numbers):
    list= []
    for i in numbers:
        if i>=0:
            list.append(i*3)
    print(list)
    new_list = [i for i in list if i%2==0]
    new_list.sort(reverse = True)
    print("操作后的列表: ",new_list)
    print("操作前后列表元素总和之差:",sum(numbers)-sum(new_list))

def four_question(inventory):
    print(inventory["978-1234567890"])

    inventory["978-1234567890"]["stock"]+=10

    for key in inventory:
        print(inventory[key]["price"])

    if "978-0987654321" in inventory:
        print(inventory["978-0987654321"].get("stock"))
    else:
        print("书籍未找到")
        
    inventory.pop("978-3456789012")
    print(inventory)

  
def five_question(set1,set_new):
    set_train = set()
    num = 0
    for i in set1:
        if num==5:
            break
        set_train.add(i)
        num+=1
    print("没有参加培训课程的员工ID集合:",set1-set_train)
    set1.update(set_new)
    print(set1)
    print("既参加了培训又是新加入公司的员工:",set_new & set_train)